<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312"/>
</head>
<!--#include file="inc/config.asp"-->
<!--#include file="mdb.asp"-->
<!--#include file="inc/format.asp"-->
<%
server_v1=Cstr(Request.ServerVariables("HTTP_REFERER"))
server_v2=Cstr(Request.ServerVariables("SERVER_NAME"))
if mid(server_v1,8,len(server_v2))<>server_v2 then
Response.Write("<script language=javascript>alert('你提交的路径有误，禁止从站点外部提交数据请不要乱改参数！');this.location.href='index.asp';</script>") 
response.end
end if
set rs=server.CreateObject("adodb.recordset")
rs.open "select fl_name,fl_name from friendlink where fl_name='"&trim(request.form("fl_name"))&"' or fl_url='"&trim(request.form("fl_url"))&"'",conn,1,1
if not rs.eof and not rs.bof then
	   	   Response.Write("<script language=javascript>alert('错误提示：\n\n① 您的站点已经提交过，正在等待审核通过，请不要重复提交!\n\n② 您的站点已经通过审核，请不要重复提交!\n\n③ 您的站点已经通过审核，但是因为违反协议已被拉入黑名单，请跟管理员联系!');</script>")
		   Response.End
rs.close
end if
dim isimage
isimage=true
sql="select * from friendlink"
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,3
rs.addnew
if trim(request.form("fl_name"))="" then
   founderr=true
   Response.Write("<script language=javascript>alert('站点名称未填写！');</script>")
else
  if strLength(trim(request.form("fl_name")))>50 then
      founderr=true
	Response.Write("<script language=javascript>alert('站点名称太长，不可以超过50个字符！');</script>")
  else
      rs("fl_name")=trim(request.form("fl_name"))
  end if
end if
if trim(request.form("fl_url"))="" then
   founderr=true
   Response.Write("<script language=javascript>alert('站点地址未填写！');</script>")
else
  if strLength(trim(request.form("fl_url")))>150 then
      founderr=true
	  Response.Write("<script language=javascript>alert('站点地址太长，不可以超过150个字符！');</script>")
  else
      rs("fl_url")=trim(request.form("fl_url"))
  end if
end if
if cint(request.Form("flcat_id"))<1 then
      founderr=true
	  Response.Write("<script language=javascript>alert('请选择分类！');</script>")
else
   sql="select isimage from flcat where flcat_id="&cint(request.Form("flcat_id"))
   set rs2=server.createobject("adodb.recordset")
   rs2.open sql,conn,1,1
   if rs2("isimage")=1 then
     isimage=false
   end if
   rs2.close
   set rs2=nothing
   rs("flcat_id")=cint(request.Form("flcat_id"))
end if
if trim(request.form("fl_logo"))<>"" then
if strLength(trim(request.form("fl_logo")))>100 then
      founderr=true
	  Response.Write("<script language=javascript>alert('站点logo地址太长，不可以超过150个字符！');</script>")
  else
      rs("fl_logo")=trim(request.form("fl_logo"))
end if
end if
rs("passed")=1
rs("lk")=0
rs.update
rs.close
set rs=nothing
Response.Write("<script language=javascript>alert('已经成功提交，请等待批准。请确认已经在您的站点加入我们相应的链接!');</script>")
%>
<body>
</body>
</html>